#include <gtest/gtest.h>

#include "time.h"

using namespace std;

TEST(Time, test)
{
  Time t1;
  Time t2(4.3);

  ASSERT_NEAR(4.3, t2.value, 1e-100);

  t1.value = 1.2;
  Time t3 = t1 + t2;

  ASSERT_NEAR(1.2, t1.value, 1e-100);
  ASSERT_NEAR(5.5, t3.value, 1e-100);

  t3 += Time(1.0);
  ASSERT_NEAR(6.5, t3.value, 1e-100);

  t3 -= Time(2.0);
  ASSERT_NEAR(4.5, t3.value, 1e-100);
}
